#include "thread_pool.h"
#include "task_queue.h"
#include <stdlib.h>
#include <strings.h>

int thread_pool_init(thread_pool_t *thread_pool, int num) {
  bzero(thread_pool, sizeof(thread_pool_t));
  thread_pool->thread_num = num;
  thread_pool->tid_arr = (pthread_t *)calloc(num, sizeof(pthread_t));
  pthread_mutex_init(&thread_pool->task_queue.mutex, NULL);
  pthread_cond_init(&thread_pool->task_queue.cond, NULL);
  return 0;
}
